package imath

func Abs(v int) int {
	if v < 0 { return -v }
	return v;
}

func Min(values ... int) (min int) {
	min = values[0]
	for _, v := range values {
		if v < min { min = v }
	}
	return
}

func Max(values ... int) (max int) {
	max = values[0]
	for _, v := range values {
		if v > max { max = v }
	}
	return
}

func Clamp(v, min, max int) int {
	return Max(Min(v, max), min)
}
